require.config({
    baseUrl: "js/vendor",
    paths: {
        "jquery": "jquery-3.4.1.min",
        "bootstrap": "bootstrap.bundle.min",
        "modernizr": "modernizr-3.8.0.min",
    },
    shim:{
        'bootstrap':['jquery']
    }
});
require(['jquery'],function($){
    // AMD模块的写法

  var topmvbg, topmv;
  $(function () {
    function a() {
      const a = $(window).width();
      if (a <= 768) {
        topmvbg = new Swiper(".mv__bg__swiper-container", {
          slidesPerView: 1,
          centeredSlides: !0,
          speed: 400,
          initialSlide: 2,
          effect: "fade",
          autoplay: {delay: 4e3}
        });

        topmv = new Swiper(".mv__swiper-container", {
          slidesPerView: 1,
          centeredSlides: !0,
          loop: !1,
          speed: 400,
          initialSlide: 2,
          navigation: {
            nextEl: ".mv__swiper-container .swiper-button-next",
            prevEl: ".mv__swiper-container .swiper-button-prev"
          },
          pagination: {el: ".mv__swiper-container .swiper-pagination", clickable: !0},
          effect: "fade",
          fadeEffect: {crossFade: !0},
          on: {
            slideChangeTransitionStart: function () {
              topmvbg.slideToLoop(this.realIndex)
            }
          }
        })
      }else {
        topmvbg = new Swiper(".mv__bg__swiper-container", {
          slidesPerView: 1,
          centeredSlides: true,
          loop: false,
          autoplay: false,
          speed: 400,
          initialSlide: 2,
          effect: "fade"
        });
        topmv = new Swiper(".mv__swiper-container", {
          slidesPerView: 1,
          centeredSlides: !0,
          loop: false,
          speed: 400,
          initialSlide: 2,
          navigation: {
            nextEl: ".mv__swiper-container .swiper-button-next",
            prevEl: ".mv__swiper-container .swiper-button-prev"
          },
          pagination: {el: ".mv__swiper-container .swiper-pagination", clickable: !0},
          effect: "fade",
          fadeEffect: {crossFade: !0},
          on: {
            slideChangeTransitionStart: function () {
              topmvbg.slideToLoop(this.realIndex)
            }
          }
        })
      }

    }
    a();
    $(window).on("resize", function () {
      a()
    });
    new Swiper(".lineup__swiper-container", {
      slidesPerView: 3,
      centeredSlides: !0,
      loop: !0,
      speed: 400,
      initialSlide: 2,
      navigation: {
        nextEl: ".lineup__swiper-container .swiper-button-next",
        prevEl: ".lineup__swiper-container .swiper-button-prev"
      },
      pagination: {el: ".lineup__swiper-container .swiper-pagination", clickable: !0},
      breakpoints: {768: {slidesPerView: 1}},
      on: {
        slideChangeTransitionStart: function () {
          let selector = ".lineup__swiper-container";
          switch (this.realIndex) {
            case 0:
              $(selector).addClass("black_on"), $(selector).removeClass("pink_on"), $(selector).removeClass("gold_on"), $(selector).removeClass("silver_on"), $(selector).removeClass("red_on");
              break;
            case 1:
              $(selector).addClass("gold_on"), $(selector).removeClass("pink_on"), $(selector).removeClass("black_on"), $(selector).removeClass("silver_on"), $(selector).removeClass("red_on");
              break;
            case 2:
              $(selector).addClass("pink_on"), $(selector).removeClass("black_on"), $(selector).removeClass("gold_on"), $(selector).removeClass("silver_on"), $(selector).removeClass("red_on");
              break;
            case 3:
              $(selector).addClass("silver_on"), $(selector).removeClass("pink_on"), $(selector).removeClass("gold_on"), $(selector).removeClass("black_on"), $(selector).removeClass("red_on");
              break;
            case 4:
              $(selector).addClass("red_on"), $(selector).removeClass("pink_on"), $(selector).removeClass("gold_on"), $(selector).removeClass("silver_on"), $(selector).removeClass("black_on")
          }
        }
      }
    });
    $("#menubtn").click(function () {
      $(".header").toggleClass("on")
    }), $("#mv_nav,#to_top").click(function (a) {
      a.preventDefault(), $("html,body").animate({scrollTop: 0})
    }), $("#about_nav").click(function (a) {
      a.preventDefault(), $("html,body").animate({scrollTop: $("#about").offset().top - $(".header").innerHeight()})
    }), $("#other_nav,#other_nav2").click(function (a) {
      a.preventDefault(), $("html,body").animate({scrollTop: $("#other").offset().top - $(".header").innerHeight()})
    }), $("#footer_nav").click(function (a) {
      a.preventDefault(), $("html,body").animate({scrollTop: $(".footer").offset().top - $(".header").innerHeight()})
    }), $(".mv__scrollbtn").click(function () {
      $("html,body").animate({scrollTop: $("#about").offset().top - $(".header").innerHeight()})
    }), $(".faq dt").click(function () {
      $(this).toggleClass("on"), $(this).next("dd").slideToggle()
    }), $(window).scroll(function (a) {
      var b = $(this).scrollTop();
      b + $(window).height() / 2 > $("#mv").offset().top && b + $(window).height() / 2 < $("#mv").offset().top + $("#mv").height() ? $("#mv_nav").addClass("on") : $("#mv_nav").removeClass("on"), b + $(window).height() / 2 > $("#about").offset().top && b + $(window).height() / 2 < $("#about").offset().top + $("#about").height() ? $("#about_nav").addClass("on") : $("#about_nav").removeClass("on"), b + $(window).height() / 2 > $("#construction").offset().top && $("#construction").addClass("on"), $(".scrollAnimate").each(function () {
        b + ($(window).height() - 200) > $(this).offset().top && $(this).addClass("on")
      }), $(".scrollAnimate__parent").each(function () {
        b + ($(window).height() - 200) > $(this).offset().top && $(this).addClass("on")
      }), b > $(".fixed_btn").innerHeight() ? $(".fixed_btn").addClass("on") : $(".fixed_btn").removeClass("on")
    }), $(window).trigger("scroll"), $(".loader").addClass("on")
  });
});
